package net.yondervision.hrfsp.sdk.esign.domain;

import cn.hutool.http.Method;
import lombok.Data;

/**
 * @author Cash Zhang
 * @version v1.0
 * @since 2019/09/26 21:17
 */
@Data
public class AbstractESignRequest {

  /**
   * host
   */
  private String serverHost;
  /**
   * 版本
   */
  private String version;
  /**
   * 应用ID
   */
  private String appId;
  /**
   * 授权码
   */
  private String accessToken;
  /**
   * 参数类型path参数
   */
  private ParamPath paramPath;
  /**
   * 参数类型query参数
   */
  private ParamQuery paramQuery;
  /**
   * 参数类型body参数
   */
  private ParamBody paramBody;

  /**
   * url
   */
  private String url;
  /**
   * 方法类型
   */
  private Method methodType;

  public void setConfig(String serverHost, String version, String appId) {
    this.serverHost = serverHost;
    this.version = version;
    this.appId = appId;
  }

  public void setConfig(String serverHost, String version, String appId, String accessToken) {
    this.serverHost = serverHost;
    this.version = version;
    this.appId = appId;
    this.accessToken = accessToken;
  }

  public void clearParams() {
    this.setServerHost(null);
    this.setAppId(null);
    this.setAccessToken(null);
    this.setParamQuery(null);
    this.setParamPath(null);
    this.setParamBody(null);
    this.setUrl(null);
    this.setMethodType(null);
  }

}
